using System.Collections.Generic;
using ScintillaNet;
using System.Xml.Serialization;

namespace FROG
{
    public class Config
    {
        private Scintilla _dummyScintilla;

        private List<Database> _databases = new List<Database>();

        public List<Database> Databases
        {
            get { return _databases; }
            set { _databases = value; }
        }

        [XmlIgnore]
        internal SnippetList Snippets
        {
            get
            {
                if (_dummyScintilla == null)
                {
                    _dummyScintilla = new Scintilla();
                    _dummyScintilla.Snippets.List.Clear();
                    foreach (CodeSnippet snp in CodeSnippets)
                    {
                        _dummyScintilla.Snippets.List.Add((Snippet)snp);
                    }
                }
                return _dummyScintilla.Snippets.List;
            }
        }

        private List<CodeSnippet> _codeSnippets;

        public List<CodeSnippet> CodeSnippets
        {
            get
            {
                return _codeSnippets;
            }
            set
            {
                _codeSnippets = value;
            }
        }
    }
}
